#ifndef __STDDEF_H__
#define __STDDEF_H__

#include "type.h"

#ifndef NULL
#define NULL ((void*)0)
#endif

#define offsetof(type, member) \
    ((size_t)(&((type*)0)->member))

#define to_struct(ptr, type, member) \
    ((type*)((char*)(ptr)-offsetof(type, member)))

#endif